# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyswf
pkgname=('python2-pyswf' 'python-pyswf')
_pkgname=pyswf
pkgver=1.5.4
pkgrel=14
pkgdesc='A Python library for reading and writing SWF files.'
arch=('any')
url='https://pypi.org/project/pyswf/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.zip")
sha512sums=('75ef5085a0cebb918eb8c613da43e4b94b25d0c90087790386dfd739a3b57f9fd42d265b63fffe842d9817d52ad3b8732ad4933c298f7f0b8ea042f63d9b8826')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyswf() {
  depends=('python2' 'python2-lxml' 'python2-pillow6' 'python2-pylzma')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-pyswf() {
  depends=('python' 'python-lxml' 'ppython-pillow6' 'python-pylzma')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

